<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

Class Bulletin_model extends CI_Model {
    public function __construct() {
        parent::__construct();
        $this->load->database();
    }
    public function weeklyBulletin() {
        $query = $this->db->query("
            SELECT bulletin_date_schedule AS schedule, bulletin_details AS details FROM tb_bulletins 
            WHERE datediff(bulletin_date_schedule, now()) <= 7 AND
            datediff(bulletin_date_schedule, now()) > 0 AND
            bulletin_barangay_id_fk=".$this->session->userdata('barangay_id')."
            LIMIT 5;
        ");
        return $query->result();
    }
}